package net.core.common;

public class MyException {
	
	/*
	 * JAVA中获取当前运行的类名，方法名，行数 
	 */
	public static String getTraceInfo() {
		StringBuffer sb = new StringBuffer();
		StackTraceElement[] stacks = new Throwable().getStackTrace();
		//int stacksLen = stacks.length;
		sb.append("class: ").append(stacks[1].getClassName()).append("; method: ").append(stacks[1].getMethodName())
				.append("; number: ").append(stacks[1].getLineNumber());
		return sb.toString();
	}
}
